package co.th.bjc.md.controller.impl;

import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import co.th.bjc.md.dao.NewLetters;
import co.th.bjc.md.helper.impl.NewLettersHelper;

public class NewLettersImpl {

	public List<NewLetters> getNewLettersAll(){
		NewLettersHelper helper = new NewLettersHelper();
		List<NewLetters> letters = new ArrayList<NewLetters>();
		try{
			letters = helper.getAllNewLetters();
		}
		catch(Exception e){
			e.printStackTrace();	
		}
		return letters;
	}
	
	public List<NewLetters> getNewLettersTop(){
		NewLettersHelper helper = new NewLettersHelper();
		List<NewLetters> letters = new ArrayList<NewLetters>();
		try{
			letters = helper.getTopNewLetters();
		}
		catch(Exception e){
			e.printStackTrace();	
		}
		return letters;
	}
	public InputStream getNewLettersImage(BigDecimal newlettersId){
		NewLettersHelper helper = new NewLettersHelper();
		InputStream image = null;
		try{
			image = helper.getImageNewLetters(newlettersId);
		}
		catch(Exception e){
			e.printStackTrace();	
		}
		return image;	
	}
	
}
